<form class="form-horizontal" action="/devices/query" method="get">
	<fieldset>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">系统类型:</label>
      <div class="controls">
        <%= select_tag :os_type, options_for_select(['ANY', 'Windows', 'Linux'], @os_type)%>
      </div>
    </div>
    <div class="control-group">
      <!-- Text input-->
      <label class="control-label">IP地址:</label>
      <div class="controls">
        <input type="text" id="ip" name="ip" value="<%= @ip %>">      
      </div>
    </div>
		<div class="control-group">
      <!-- Text input-->
      <label class="control-label"></label>
      <div class="controls">
        <input type="submit">      
      </div>
    </div>
</form>

<h1>在用设备列表</h1>

<% index = @page_index + 1%>
<p id="notice"><%= notice %></p>
<table class="table table-bordered">
  <thead>
    <tr>
      <th>No.</th>
      <th>IP</th>
      <!--
      <th>Os type</th>
      -->
      <th>系统名称</th>
      <th>系统位数</th>
      <th>浏览器</th>
      <th>浏览器位数</th>
      <th>负责人</th>
      <th>用途描述</th>
      <!--
      <th>Remark</th>
      -->
      <th colspan="3">管理</th>
    </tr>
  </thead>

  <tbody>
    <% @devices.each do |device| %>
      <tr class="<%= cycle('info', '') %>">
        <td><%= index %></td><% index = index + 1 %>
        <td><%= device.ip %></td>
        <!--
        <td><%= device.os_type %></td>
        -->
        <td><%= device.os_name %></td>
        <td><%= device.os_bit %></td>
        <td><%= device.browser_version %></td>
        <td><%= device.browser_bit %></td>
        <td><%= device.owner %></td>
        <td><%= device.description %></td>
        <!--
        <td><%= device.remark %></td>
        -->
        <td><i class="icon-search"></i><%= link_to '详细', device %></td>
        <td><i class="icon-edit"></i><%= link_to '编辑', edit_device_path(device) %></td>
        <td><i class="icon-trash"></i><%= link_to '删除', device, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>
<p><%= will_paginate @devices %></p>
<br>